package org.example.chainOfResponsibility.correctMethodEvolution;

/**
 * @author weigang
 * @create 2022-07-26 10:20
 */
public enum GatewayEnum {
    // handlerId, 拦截者名称，全限定类名，preHandlerId，nextHandlerId
//    API_HANDLER(new GatewayEntity(1, "api接口限流", "cn.dgut.design.chain_of_responsibility.GateWay.impl.ApiLimitGatewayHandler", null, 2)),
//    BLACKLIST_HANDLER(new GatewayEntity(2, "黑名单拦截", "cn.dgut.design.chain_of_responsibility.GateWay.impl.BlacklistGatewayHandler", 1, 3)),
//    SESSION_HANDLER(new GatewayEntity(3, "用户会话拦截", "cn.dgut.design.chain_of_responsibility.GateWay.impl.SessionGatewayHandler", 2, null)),

    API_HANDLER(new GatewayEntity("FirstPassHandler", "org.example.chainOfResponsibility.correctMethodEvolution.handler.FirstPassHandler", 1, null, 2)),
    BLACKLIST_HANDLER(new GatewayEntity("SecondPassHandler", "org.example.chainOfResponsibility.correctMethodEvolution.handler.SecondPassHandler", 2, 1, 3)),
    SESSION_HANDLER(new GatewayEntity("ThirdPassHandler", "org.example.chainOfResponsibility.correctMethodEvolution.handler.ThirdPassHandler", 3, 2, null)),

    ;

    GatewayEntity gatewayEntity;

    public GatewayEntity getGatewayEntity() {
        return gatewayEntity;
    }

    GatewayEnum(GatewayEntity gatewayEntity) {
        this.gatewayEntity = gatewayEntity;
    }
}
